home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
DYN401.ZIP
/
class
/
strdict.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-04-16
|
3KB
|
138 lines
/* Copyright (c) 1993-1996 Algorithms Corporation */
/* All rights reserved. */
/* This file automatically generated by dpp - do not edit */
#define DPP_STRATEGY 2
#define DPP_FASTWIDE 0
#define CLASS StringDictionary_c
#define ivType StringDictionary_iv_t
#include "generics.h"
object StringDictionary_c;
#line 23 "strdict.d"
#include "set1.h"
#define LTYPE 2
static gLookup_t Lookup;
imeth objrtn StringDictionary_im_gAddStr(object self, char *key, object value)
{
ChkArgNul(value, 3);
return Lookup(self, (object) key, HT_ADD, 0, LTYPE, value);
}
imeth objrtn StringDictionary_im_gFindValueStr(object self, char *key)
{
object x = Lookup(self, (object) key, HT_FIND, 0, LTYPE, NULL);
return x ? gValue(x) : x;
}
imeth objrtn StringDictionary_im_gFindStr(object self, char *key)
{
return Lookup(self, (object) key, HT_FIND, 0, LTYPE, NULL);
}
imeth objrtn StringDictionary_im_gChangeValueWithStr(object self, char *key, object val)
{
object x;
ChkArgNul(val, 3);
x = Lookup(self, (object) key, HT_FIND, 0, LTYPE, NULL);
return x ? gChangeValue(x, val) : x;
}
imeth objrtn StringDictionary_im_gFindAddStr(object self, char *key, object value)
{
ChkArgNul(value, 3);
return Lookup(self, (object) key, HT_FINDADD, 0, LTYPE, value);
}
imeth objrtn StringDictionary_im_gDispose(object self)
{
return gDispose1(self);
}
imeth objrtn StringDictionary_im_gDisposeAllNodes(object self)
{
return gDisposeAllNodes1(self);
}
imeth objrtn StringDictionary_im_gRemoveStr(object self, char *key)
{
return Lookup(self, (object) key, HT_DELETE, 1, LTYPE, NULL);
}
imeth objrtn StringDictionary_im_gDeepDisposeStr(object self, char *key)
{
return Lookup(self, (object) key, HT_DELETE, 2, LTYPE, NULL);
}
static void init_class(void)
{
Lookup = imcPointer(Set, gLookup);
}
#line 89 "strdict.c"
objrtn StringDictionary_initialize(void)
{
static CRITICALSECTION cs;
static int volatile once = 0;
ENTERCRITICALSECTION(_CI_CS_);
if (!once) {
INITIALIZECRITICALSECTION(cs);
once = 1;
}
LEAVECRITICALSECTION(_CI_CS_);
ENTERCRITICALSECTION(cs);
if (StringDictionary_c) {
LEAVECRITICALSECTION(cs);
return StringDictionary_c;
}
INHIBIT_THREADER;
Set_initialize();
if (StringDictionary_c) {
ENABLE_THREADER;
LEAVECRITICALSECTION(cs);
return StringDictionary_c;
}
StringDictionary_c = gNewClass(Class, "StringDictionary", 0, 0, Set, END);
iMethodFor(StringDictionary, gRemoveStr, StringDictionary_im_gRemoveStr);
iMethodFor(StringDictionary, gDisposeStr, StringDictionary_im_gDeepDisposeStr);
iMethodFor(StringDictionary, gFindStr, StringDictionary_im_gFindStr);
iMethodFor(StringDictionary, gAddStr, StringDictionary_im_gAddStr);
iMethodFor(StringDictionary, gDisposeAllNodes, StringDictionary_im_gDisposeAllNodes);
iMethodFor(StringDictionary, gDispose, StringDictionary_im_gDispose);
iMethodFor(StringDictionary, gFindAddStr, StringDictionary_im_gFindAddStr);
iMethodFor(StringDictionary, gChangeValueWithStr, StringDictionary_im_gChangeValueWithStr);
iMethodFor(StringDictionary, gFindValueStr, StringDictionary_im_gFindValueStr);
iMethodFor(StringDictionary, gDeepDisposeStr, StringDictionary_im_gDeepDisposeStr);
init_class();
ENABLE_THREADER;
LEAVECRITICALSECTION(cs);
return StringDictionary_c;
}